-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Play with workflows #41
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Only one file can be set per repo, so it should be in the root dir.
Set up global linting config for the entire monorepo.
Since we configured the linting config for the entire monorepo there is no need to keep linting per package. We want to override some config for `core` package so we add the `.eslintrc` file to set custom rule for this package. Here we temporarily switch off pre-commit config - we are going to address it in follow-up work.
Add commit hash that fixes the linting warning.
Add a script that formats code for a given workspace based on the global linting configuration. Available command line arguments: - `--workspace` or `-w`: defines the workspace name eg. core for which the code formatting will be invoked. This argument is required, - `--type` or `-t`: Determines the file type. If not defined all supported types will be formatted, - `--fix` or `-f`: should automatically fix linting errors. We want to run linting in pre-commit hook but only for those pacakges where changes are taking place. Eg. when working on `website` the pre-commit hook should only be invoked for this workspace not for the others. This script allows us to run linting for different file types: js/ts, sol and config files and, only for a given workspace.
We should run the `lint.sh` scirpt for linting to hanlde correct workspace. Note that to run this script you must add executable permissions: `chmod +x lint.sh`.
We can configure a workflow to run based on the what file paths are changed. Here we add `paths` filter under the `pull_request` event to run the `core` workflow only when changes happen in `./core` dir.
Because in this script we use bash features, the first line of the file must be `#!/bin/bash`. Otherwise GH actions won't run this script as `bash` and it will fail once problematic line is reached.
Here we add `format` and `format:fix` scripts to the root package.json file. We are going to run `format` script in the GH workflows and it will check code format for all supported types in a given workspace.
Check if the code is correctly formatted in `core` workspace based on the global linting configuration.
This is an initial implementation of the CI process to check formatting in `website` workspace.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.